Skip to content

Comments

Send git commit information as service message from ArgoCD steps#1749

Merged
sathvikkumar-octo merged 9 commits intomainfrom
sk/argo-commit-hash
Feb 11, 2026
Merged

Send git commit information as service message from ArgoCD steps#1749
sathvikkumar-octo merged 9 commits intomainfrom
sk/argo-commit-hash

Conversation

@sathvikkumar-octo
Copy link
Contributor

@sathvikkumar-octo sathvikkumar-octo commented Jan 30, 2026

Does not require the corresponding server PR as the service message will be ignored

References MD-1489

Sends a service message per ArgoCD app with all source details
Tested manually with corresponding server PR with image and manifest update ArgoCD steps

Copy link
Contributor

@eddymoulton eddymoulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just some minor comments to consider.

I'd recommend setting up the Server side part of this too before we merge it in just in case we find something we didn't think of.

- One service message per application (not per source)
- Sources serialized as JSON array with commit SHA and source index
- Replaced/patched files tracked per-source (architecturally correct)
- Deployment ID extracted from server context (not in payload)
- Shared ProcessApplicationResult class across conventions
- Reporter injected via DI and called after processing
- Add CreateConvention() helpers in test classes
- Replace 29 duplicate constructor calls with helpers
- Allows easy customization via optional parameters
- Construct result object inline with all properties
- Remove intermediate local variables
- Cleaner, more readable code
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new ArgoCD deployment service message to expose per-source Git commit SHAs (and related source metadata) for ArgoCD manifest/image update steps.

Changes:

  • Introduces argocd-deployment service message constants and a new ArgoCDDeploymentReporter that emits deployment service messages.
  • Captures the Git commit SHA after committing ArgoCD manifest/image changes and threads it into a shared ProcessApplicationResult model.
  • Updates ArgoCD conventions/commands/tests to wire in the reporter and new result model.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
source/Calamari/Kubernetes/SpecialVariables.cs Adds argocd-deployment service message name/attributes.
source/Calamari/ArgoCD/ProcessApplicationResult.cs New shared result model including per-source commit SHA details.
source/Calamari/ArgoCD/Git/RepositoryWrapper.cs Adds GetCommitSha() helper for retrieving HEAD commit SHA.
source/Calamari/ArgoCD/Conventions/UpdateArgoCDApplicationManifestsInstallConvention.cs Captures commit SHA for manifest updates; reports deployments via reporter.
source/Calamari/ArgoCD/Conventions/UpdateArgoCDAppImagesInstallConvention.cs Captures commit SHA for image updates; reports deployments via reporter.
source/Calamari/ArgoCD/Commands/UpdateArgoCDAppManifestsCommand.cs Wires reporter into manifests convention construction.
source/Calamari/ArgoCD/Commands/UpdateArgoCDAppImagesCommand.cs Wires reporter into images convention construction.
source/Calamari/ArgoCD/ArgoCDModule.cs Registers IArgoCDDeploymentReporter in Autofac.
source/Calamari/ArgoCD/ArgoCDDeploymentReporter.cs New reporter emitting argocd-deployment service messages with serialized source details.
source/Calamari.Tests/ArgoCD/Commands/Conventions/UpdateArgoCDApplicationManifestsInstallConventionTests.cs Updates construction to satisfy new reporter dependency.
source/Calamari.Tests/ArgoCD/Commands/Conventions/UpdateArgoCDAppImagesInstallConventionTest.cs Updates construction to satisfy new reporter dependency.
source/Calamari.Tests/ArgoCD/Commands/Conventions/UpdateArgoCDAppImagesInstallConventionHelmTests.cs Updates construction to satisfy new reporter dependency.
source/Calamari.Tests/ArgoCD/ArgoCDDeploymentReporterTests.cs Adds unit tests for reporter service message output/serialization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Changed init properties to constructor parameters
- Makes object truly immutable after construction
- Updated all call sites to use new constructor signature
@sathvikkumar-octo sathvikkumar-octo changed the title Expose git commit SHA as output variable for ArgoCD steps Send git commit information as service message from ArgoCD steps Feb 10, 2026
Copy link
Contributor

@flin-8 flin-8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM + comments

@sathvikkumar-octo sathvikkumar-octo merged commit dcdd23d into main Feb 11, 2026
33 checks passed
@sathvikkumar-octo sathvikkumar-octo deleted the sk/argo-commit-hash branch February 11, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants